package 常用类.day2.匿名内部类;

public class Test {
    public static void main(String[] args) {
        Person p=new Son();
        p.eat();

        Person p1=new Person() {
            public void eat() {
                System.out.println("匿名内部类的eat");
            }
        };

        p1.eat();

        Person p2=()-> {
                System.out.println("匿名内部类的eat");
        };

        p2.eat();
    }
}
